package Homework01;

public class Test {
    public static void main(String[] args) {
        Animal a = new Dog();
        if(a instanceof Dog){
            ((Dog)a).WatchHome();//让狗回归本心，把被看做动物的狗强转回狗调用WatchHome方法
        }
        a.eat();
        a = new Cat();
        if(a instanceof Cat){
            ((Cat)a).catchMouse();
        }
        a.eat();
    }
}
